﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="Bookworm.Layout"
    Title="Layout" Width="1024" Height="768"  WindowStartupLocation="CenterScreen" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:l="clr-namespace:Bookworm" xmlns:Controls="clr-namespace:Bookworm.Controls;assembly=Bookworm.Controls">
    <Window.Resources>
        <SolidColorBrush x:Key="NormalBrush" Color="#585858"/>
        <SolidColorBrush x:Key="PressedBrush" Color="Black"/>
        <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />       
        <SolidColorBrush x:Key="GlyphBrush" Color="#FF040000" />
        <SolidColorBrush x:Key="GlyphMouseOver" Color="#FFE8E8E8"/>
        <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Border
                                Name="Border"
                                Margin="1"
                                CornerRadius="0"
                                Background="{StaticResource NormalBrush}"
                                BorderBrush="{StaticResource NormalBrush}"
                                BorderThickness="1">
                                                            <Path
                                Name="glyph"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Fill="{StaticResource GlyphBrush}"
                                Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="glyph" Property="Fill" Value="{StaticResource GlyphMouseOver}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="glyph" Property="Fill" Value="{StaticResource PressedBrush}" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>             
        <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Border Background="Transparent" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Rectangle
                                    Name="rectThumb"
                                    RadiusX="3"
                                    RadiusY="3"
                                    Fill="{TemplateBinding Background}"
                                    />
                                                            <!--<ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="rectThumb" Property="Fill" Value="{StaticResource GlyphMouseOver}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter TargetName="rectThumb" Property="Fill" Value="Black"/>
                            </Trigger>
                        </ControlTemplate.Triggers>-->
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ScrollBarLineButtonStyle" TargetType="{x:Type RepeatButton}">
            <Setter Property="Focusable" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Grid Margin="1">
                            <Ellipse Name="Border" StrokeThickness="1" 
                            Stroke="#FFF9F005" Opacity="0.7">
                            	<Ellipse.Fill>
                            		<RadialGradientBrush>
                            			<GradientStop Color="#FFF4DA74" Offset="0"/>
                            			<GradientStop Color="#FF080700" Offset="1"/>
                            			<GradientStop Color="#FFE4F013" Offset="0"/>
                            			<GradientStop Color="#FFD2B103" Offset="0.804"/>
                            			<GradientStop Color="#FFEAF70E" Offset="0.442"/>
                            		</RadialGradientBrush>
                            	</Ellipse.Fill></Ellipse>
                            <ContentPresenter HorizontalAlignment="Center"
                                                VerticalAlignment="Center">                                
                            </ContentPresenter>
                        </Grid>
                        <!--<ControlTemplate.Triggers>                            
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Fill"
                                        Value="{StaticResource PressedBrush}" />
                            </Trigger>
                        </ControlTemplate.Triggers>-->
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
            <Grid >               
                <Grid.ColumnDefinitions>
                    <!--<ColumnDefinition MaxWidth="18"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition MaxWidth="18"/>-->
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="5" />
                    <ColumnDefinition Width="*" />                    
                </Grid.ColumnDefinitions>
                <Border
                            Grid.ColumnSpan="3"
                            CornerRadius="0"
                            Background="Transparent" />
                <RepeatButton
                            Grid.Column="0"
                            Style="{StaticResource ScrollBarLineButtonStyle}"
                            Width="18"
                    HorizontalAlignment="Right"
                            Command="ScrollBar.LineLeftCommand">                  
                            <Path Fill="{StaticResource GlyphBrush}"
                                   Data="M 8 0 L 8 8 L 0 4 Z">
                              </Path>                                    
                </RepeatButton>
                <Track
                            Name="PART_Track"
                            Grid.Column="1"
                            IsDirectionReversed="False">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton
                            Style="{StaticResource ScrollBarPageButton}"
                             />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb
                            Style="{StaticResource ScrollBarThumb}"
                            Margin="0,5,0,5"
                            Background="Transparent"
                            BorderBrush="Transparent" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton
                            Style="{StaticResource ScrollBarPageButton}"
                             />
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton
                            Grid.Column="3"
                            Style="{StaticResource ScrollBarLineButtonStyle}"
                            Width="18"   
                    HorizontalAlignment="Left"
                            Command="ScrollBar.LineRightCommand">
                    <Path Fill="{StaticResource GlyphBrush}"
                                   Data="M 0 0 L 8 4 L 0 8 Z">
                    </Path>
                </RepeatButton>                            
            </Grid>
        </ControlTemplate>
        <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Horizontal">
                    <Setter Property="Width" Value="Auto"/>
                    <Setter Property="Height" Value="18" />
                    <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
                </Trigger>
            </Style.Triggers>
        </Style>
        <XmlDataProvider x:Key="booksDS" d:IsDataSource="True" Source="books.xml"/>
        <DataTemplate x:Key="bookItemTemplate">
            <DataTemplate.Resources>
                <Storyboard x:Key="OnMouseEnter1">
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                        <!--<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1.25" />-->
                        <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1.5" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                        <!--<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1.25" />-->
                        <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1.5" />
                    </DoubleAnimationUsingKeyFrames>                    
                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                        <SplineThicknessKeyFrame KeyTime="00:00:00" Value="5,5,5,5"/>
                        <!--<SplineThicknessKeyFrame KeyTime="00:00:00.2" Value="15,15,15,15"/>
                        <SplineThicknessKeyFrame KeyTime="00:00:00.3" Value="40,40,40,40"/>-->
                        <SplineThicknessKeyFrame KeyTime="00:00:00.4" Value="60,60,60,60"/>
                    </ThicknessAnimationUsingKeyFrames>
                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="brBookItemBorder" Storyboard.TargetProperty="(Border.BorderThickness)">
                        <SplineThicknessKeyFrame KeyTime="00:00:00" Value="1,1,1,1"/>
                        <SplineThicknessKeyFrame KeyTime="00:00:00.4" Value="2,2,2,2"/>
                    </ThicknessAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(UIElement.Opacity)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value=".75" />
                        <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value=".85" />
                        <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
                <Storyboard x:Key="OnMouseLeave1">
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.5"/>
                        <!--<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1.25"/>-->
                        <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.5"/>
                        <!--<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1.25"/>-->
                        <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                    </DoubleAnimationUsingKeyFrames>
                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                        <SplineThicknessKeyFrame KeyTime="00:00:00" Value="60,60,60,60"/>
                        <!--<SplineThicknessKeyFrame KeyTime="00:00:00.2" Value="45,45,45,45"/>-->
                        <SplineThicknessKeyFrame KeyTime="00:00:00.4" Value="5,5,5,5"/>
                    </ThicknessAnimationUsingKeyFrames>
                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="brBookItemBorder" Storyboard.TargetProperty="(Border.BorderThickness)">
                        <SplineThicknessKeyFrame KeyTime="00:00:00" Value="2,2,2,2"/>
                        <SplineThicknessKeyFrame KeyTime="00:00:00.4" Value="1,1,1,1"/>
                    </ThicknessAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(UIElement.Opacity)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                        <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value=".85" />
                        <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value=".75" />
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
                <Storyboard x:Key="OnPageLoaded">       
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>                        
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dkBookItem" Storyboard.TargetProperty="(UIElement.Opacity)">
                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value=".75" />                
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
                
            </DataTemplate.Resources>            
            <DockPanel x:Name="dkBookItem"  Margin="5,5,5,5">                
                <Border DockPanel.Dock="Top" SnapsToDevicePixels="True" x:Name="brBookItemBorder" Opacity=".75" BorderThickness="1,1,1,1" RenderTransformOrigin="0.5,0.5" OpacityMask="{x:Null}" CornerRadius="20,20,20,20" BorderBrush="#FFECD903">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FF8E7F1F" Offset="0.629"/>
                            <GradientStop Color="#FF181802" Offset="0.938"/>
                            <GradientStop Color="#FF10100F" Offset="0.125"/>
                            <GradientStop Color="#FF393411" Offset="0.384"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <Border.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1" ScaleY="1"/>
                            <SkewTransform AngleX="0" AngleY="0"/>
                            <RotateTransform Angle="0"/>
                            <TranslateTransform X="0" Y="0"/>
                        </TransformGroup>
                    </Border.RenderTransform>
                    
                        <Grid Background="Transparent">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="{Binding XPath=title}"                                   
                                   Width="170"                                      
                                   TextWrapping="Wrap"
                                   TextAlignment="Left" 
                                   Grid.ColumnSpan="2"
                                   Margin="10,10,10,10"                                    
                                   Foreground="#FFF2CF17"
                                   FontFamily="Bookman Old Style"
                                   FontWeight="Bold"
                                   FontSize="14" >
                        	<TextBlock.Background>
                        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        			<GradientStop Color="#FF000000" Offset="0"/>
                        			<GradientStop Color="#FF665C2A" Offset="1"/>
                        			<GradientStop Color="#FF221E0E" Offset="0.335"/>
                        		</LinearGradientBrush>
                        	</TextBlock.Background>
                        </TextBlock>
                            <DockPanel Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Left" Margin="5,5,5,5" Opacity="0.8">
                                <DockPanel.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF000000" Offset="0"/>
                                        <GradientStop Color="#FF131003" Offset="1"/>
                                    </LinearGradientBrush>
                                </DockPanel.Background>
                                <Border x:Name="brBookItem"
                                     DockPanel.Dock="Top"
                                     BorderThickness="5"
                           >
                                    <Image Source="{Binding XPath=image}"
                               Height="80"
                               Width="50"
                               Stretch="Fill"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Stretch" 
                               Opacity="1"
                               x:Name="frontCover"/>
                                </Border>
                                <Border Width="50" Height="40" DockPanel.Dock="Top">
                                    <Border.Background>
                                        <VisualBrush Visual="{Binding ElementName=frontCover}">
                                            <VisualBrush.Transform>
                                                <ScaleTransform ScaleX="1"  ScaleY="0" CenterX="70" CenterY="20"/>
                                            </VisualBrush.Transform>
                                        </VisualBrush>
                                    </Border.Background>
                                    <Border.OpacityMask>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                            <GradientStop Offset="0" Color="Black"/>
                                            <GradientStop Offset="0.6" Color="Transparent"/>
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                            </DockPanel>
                            <StackPanel Grid.Column="1" Grid.Row="1" SnapsToDevicePixels="True" Grid.RowSpan="2">
                                <TextBlock Text="{Binding XPath=Author}"                                         
                                        TextWrapping="Wrap"
                                        TextAlignment="Left"                                   
                                        Margin="5,5,5,5"
                                        Foreground="#FFFDE909"                               
                                        FontWeight="Bold"
                                        FontFamily="Bookman Old Style"
                                        FontSize="6"/>
                        </StackPanel>

                        </Grid>                                                              
                </Border>
                <Border  Height="60" DockPanel.Dock="Top">
                    <Border.Background>
                        <VisualBrush Visual="{Binding ElementName=brBookItemBorder}">
                            <VisualBrush.Transform>
                                <ScaleTransform ScaleX="1"  ScaleY="-1" CenterX="70" CenterY="30"/>
                            </VisualBrush.Transform>
                        </VisualBrush>
                    </Border.Background>
                    <Border.OpacityMask>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Offset="0" Color="Black"/>
                            <GradientStop Offset="0.8" Color="Transparent"/>
                        </LinearGradientBrush>
                    </Border.OpacityMask>
                </Border>
            </DockPanel>
            <DataTemplate.Triggers>
                <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="dkBookItem"
                              >
                    <BeginStoryboard x:Name="MouseEnter_BeginStoryboard" Storyboard="{StaticResource OnMouseEnter1}"/>
                </EventTrigger>
                <EventTrigger RoutedEvent="Mouse.MouseLeave"
                              >
                    <BeginStoryboard x:Name="MouseLeave_BeginStoryboard" Storyboard="{StaticResource OnMouseLeave1}"/>
                </EventTrigger>
                <EventTrigger RoutedEvent="Mouse.MouseLeave"
                              >
                    <BeginStoryboard x:Name="PageLoaded_BeginStoryboard" Storyboard="{StaticResource OnMouseLeave1}"/>
                </EventTrigger>
                <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                    <BeginStoryboard Storyboard="{StaticResource OnPageLoaded}" />
                </EventTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
        <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
            <VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        </ItemsPanelTemplate>
        <SolidColorBrush x:Key="ListBorder" Color="#828790"/>
        <Style x:Key="ListBoxStyle1" TargetType="{x:Type ListBox}">
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBox}">
                        <Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
                            <!--<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}" x:Name="scrollViewer">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                            </ScrollViewer>-->
                            <Controls:CyclicScrollViewer x:Name="scrollViewer"
                                Padding="{TemplateBinding Padding}" 
                                Focusable="False">
                               <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                            </Controls:CyclicScrollViewer>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                                <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsGrouping" Value="true">
                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="bookListStyle"
               TargetType="{x:Type ListBoxItem}">
            <Style.Resources>
                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
                                 Color="Transparent"/>
                <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}"
                                 Color="Transparent"/>
            </Style.Resources>
        </Style>
    </Window.Resources>
    <Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF000000" Offset="0.125"/>
            <GradientStop Color="#FF6D6D32" Offset="0.446"/>
            <GradientStop Color="#FF050505" Offset="0.915"/>
            <GradientStop Color="#FF71714C" Offset="0.616"/>
            <GradientStop Color="#FFEDED85" Offset="0.589"/>
        </LinearGradientBrush>
    </Window.Background>
    <Window.BorderBrush>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF3C3B32" Offset="0.411"/>
            <GradientStop Color="#FFFFFFFF" Offset="1"/>
        </LinearGradientBrush>
    </Window.BorderBrush>
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
        
    </Window.Triggers>
    <DockPanel>
        <ListBox IsSynchronizedWithCurrentItem="False"                     
                     BorderBrush="{x:Null}" 
                     ScrollViewer.CanContentScroll="False"                
                     ItemContainerStyle="{StaticResource bookListStyle}"
                     ItemTemplate="{DynamicResource bookItemTemplate}"
                     ItemsPanel="{DynamicResource ItemsPanelTemplate1}" 
                     ItemsSource="{Binding Mode=Default, Source={StaticResource booksDS}, XPath=/books/book}"
                     Style="{DynamicResource ListBoxStyle1}"
                     HorizontalAlignment="Stretch"
                     IsEnabled="True" 
               DockPanel.Dock="Bottom"
                     Margin="0,210,0,0" 
                     VerticalAlignment="Stretch" 
                     HorizontalContentAlignment="Center" 
                     VerticalContentAlignment="Center" 
                     x:Name="bookList" Height="435.607" Background="{x:Null}" Foreground="{x:Null}" Opacity="0.875" BorderThickness="0,0,0,0" ClipToBounds="True" SnapsToDevicePixels="True" OpacityMask="{x:Null}" OverridesDefaultStyle="True">
            <ListBox.BitmapEffect>
                <DropShadowBitmapEffect Direction="343" Opacity="0.75" Softness="0.525" ShadowDepth="10"/>
            </ListBox.BitmapEffect>
        </ListBox>        
    </DockPanel>        
</Window>
